function y = fletcbv3(x)
%FLETCBV3 Fuction
%x0=[h,2h,...,nh]
%fmin=f79([1;1])=0
%Author:cai li
n=length(x);
p=1e-8;h=1/(n+1);c=1;
y=0.5*p*(x(1)^2+x(n)^2);
for i=1:n-1
    y=y+(p/2)*(x(i)-x(i+1))^2;
end
for j=1:n
    y=y-(p*(h^2+2)*x(j)/h^2+c*p*cos(x(j))/h^2);
end